package com.example.java250729_springboot;

import org.springframework.web.bind.annotation.*;

@RequestMapping("hello")
@RestController
public class HelloSpringBoot {

    /**
     * 全部都支持
     * @return
     */
    @RequestMapping("/v2")
    public String v2(){
        return "hello";
    }

    /**
     * 支持get请求
     * @return
     */
    @GetMapping("/v3")
    //@RequestMapping(value = "/v3",method = RequestMethod.GET)
    public String v3(){
        return "hello";
    }
    /**
     * 支持post请求
     * @return
     */
    @PostMapping("/v4")
    //@RequestMapping(value = "/v4",method = RequestMethod.POST)
    public String v4(){
        return "hello";
    }
    /**
     * 支持post和get请求
     * @return
     */
    @RequestMapping(value = "/v5",method = {RequestMethod.GET,RequestMethod.POST})
    public String v5(){
        return "hello";
    }

    @GetMapping("/v6")
    //@RequestMapping(value = "/v3",method = RequestMethod.GET)
    public String v6(){
        return "hello v6";
    }
    /**
     * 支持post请求
     * @return
     */
    @PostMapping("/v6")
    //@RequestMapping(value = "/v4",method = RequestMethod.POST)
    public String v7(){
        return "hello v7";
    }

//    @RequestMapping(value = "/v8",method = {RequestMethod.GET,RequestMethod.POST})
//    public String v8(){
//        return "hello v8";
//    }@RequestMapping(value = "/v8",method = {RequestMethod.GET,RequestMethod.POST})
//    public String v9(){
//        return "hello v9";
//    }
}
